<?php
//viewAssignment.php
//Contains the homepage functionality. - jlg

//External access to this page is permitted. - jlg
$allow=true;

require_once("overhead.php");

//Get the ID from the url
$assignmentNumber = (isset($_GET['aid']) ? $_GET['aid'] : 0);

//Get the assignments for the current course
$getAssignmentData = mysql_query("SELECT * FROM assignment WHERE ID = " .$assignmentNumber);
$assignmentData = null;
while ($row=mysql_fetch_assoc($getAssignmentData)) {
	$assignmentData['ID'] = $row['ID'];
	$assignmentData['CourseID'] = $row['CourseID'];
	$assignmentData['JUnit Test'] = $row['JUnit Test'];
	$assignmentData['Status'] = $row['Status'];
	$assignmentData['Description'] = $row['Description'];
	$assignmentData['Name'] = $row['Name'];
}

//Pull in the view depending on the current user's role - rjs
if ($currentRole=="instructor") {
	include_once("viewAssignment_instructor.php");
} else {
	include_once("viewAssignment_student.php");
}
?>